# --------------------------------
# -*- coding: utf-8 -*-
# Author: Zhu
# Date: 2021/12/16   
# Description:
# --------------------------------
import time
from PageLocators.page_customermanagement_loc import ele_CUSTOMER_MANAGMENT as loc
from Common.Base import Base
from Common.GetLog import GetLog
log = GetLog.get_logger()

class fun_CUSTOMER_MANAGEMENT(Base):
    u'作业端-基础资料-【客户管理】页面元素操作方法'

    def m_Customer_Management(self):
        '''
        点击作业端-基础资料-【货主管理】-【客户管理】，展开客户管理页面
        :return:
        '''
        log.info("")
        print("")
        self.base_click(loc.ys_Customer_List)
        time.sleep(1)

    def m_Create_Customer(self):
        '''
        点击新建客户
        :return:
        '''
        log.info("点击新建客户")
        print("点击新建客户")
        self.base_click(loc.ys_Create_Customer_Btn)
        time.sleep(1)

    def m_InputCustomer(self,Customer_Name,Customer_Bm,Customer_Contact,Customer_ContactPhone,PhoneGH,Address,Remark):
        '''
        输入客户资料
        :return:
        '''
        log.info("开始输入客户信息")
        print("开始输入客户信息")

        log.info("输入-客户名称")
        print("输入-客户名称")
        self.base_input(loc.ys_Customer_Name, Customer_Name)
        time.sleep(1)

        log.info("输入-客户编码")
        print("输入-客户编码")
        self.base_input(loc.ys_Customer_Bm, Customer_Bm)
        time.sleep(1)

        log.info("输入-联系人")
        print("输入-联系人")
        self.base_input(loc.ys_Customer_Contact, Customer_Contact)
        time.sleep(1)

        log.info("输入-联系人手机")
        print("输入-联系人手机")
        self.base_input(loc.ys_Customer_ContactPHone, Customer_ContactPhone)
        time.sleep(1)

        log.info("输入-联系人固话")
        print("输入-联系人固话")
        self.base_input(loc.ys_Customer_PHoneGH, PhoneGH)
        time.sleep(1)

        log.info("输入-详细地址")
        print("输入-详细地址")
        self.base_input(loc.ys_Customer_Address, Address)
        time.sleep(1)

        log.info("输入-备注")
        print("输入-备注")
        self.base_input(loc.ys_Customer_Remark, Remark)
        time.sleep(1)

    def m_Choose_shipper(self):
        '''
        选择货主
        :return:
        '''
        log.info("点击货主，展开货主列表")
        print("点击货主，展开货主列表")
        self.base_click(loc.ys_CustomerShipper)
        time.sleep(1)

        self.base_click(loc.ys_CustomerShipper_Choose)
        time.sleep(1)

    def m_Choose_CustomerGrade(self):
        '''
        选择客户等级
        :return:
        '''
        log.info("点击客户等级，展开客户等级列表")
        print("点击客户等级，展开客户等级列表")
        self.base_click(loc.ys_Customer_Grade)
        time.sleep(1)

        self.base_click(loc.ys_Customer_Grade2)
        time.sleep(1)

    def m_Choose_CustomerType(self):
        '''
        选择客户类型
        :return:
        '''
        log.info("点击客户类型，展开客户类型列表")
        print("点击客户类型，展开客户类型列表")
        self.base_click(loc.ys_Customer_type)
        time.sleep(1)

        self.base_click(loc.ys_Customer_type2)
        time.sleep(1)

    def m_Submit_CreateBtn(self):
        '''
        提交创建客户按钮
        :return:
        '''
        log.info("提交创建客户按钮")
        print("提交创建客户按钮")
        self.base_click(loc.ys_CreateCustomer_Submit)
        time.sleep(1)




